<?php

namespace app\index\controller;

use think\Controller;
use think\Db;
use think\Request;
use think\facade\Session;

class Login extends Controller
{

    public function index()
    {
        if(request()->isPost()){

            $name=input('param.username');
            $pwd=input('param.password');

            $date=Db::table('user')->where(input('param.'))->find();
          
            if(count($date)>0){
                session::set("username",input('param.username'));
                $this->success('登陆成功','stu/index');
            }

        }
        else{
            return view('index');
        }
    }



}
